package com.igor.bookStore.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.igor.bookStore.inface.Book;

public class BooksBean implements Books {

	private Map<String, Book> books = new HashMap<String, Book>();

	public Collection<Book> retrieve() {
		return books.values();
	}

	public Book save(Book customer) {
		return books.put(customer.getName(), customer);
	}

	public Book retrieveSingleBook(String name) {
		return books.get(name);
	}
	
	public Book retriveSinglebookPrice(double price) {
		return books.get(price);
	}

}
